// plugin/components/modal/index.js
Component({
  options: {
      multipleSlots: true, // 在组件定义时的选项中启用多slot支持
      addGlobalClass: true
  },
  /**
   * 组件的属性列表
   */
  properties: {
    className: {
      type: String,
      value: ''
    },
    title: {
      type: String,
      value: ''
    },
    isOpened: {
      type: Boolean,
      value: false
    },
    imgurl: {
      type: String,
      value: ''
    },
    content: {
      type: String,
      value: ''
    },
    subContent: {
      type: String,
      value: ''
    },
    closeOnClickOverlay: {
      type: Boolean,
      value: false
    },
    cancelText: {
      type: String,
      value: ''
    },
    confirmText: {
      type: String,
      value: ''
    },
    isSimple: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClose: function() {
      this.triggerEvent('close')
    },
    handleCancel: function() {
      this.triggerEvent('cancel')
    },
    handleConfirm: function() {
      this.triggerEvent('confirm')
    },
    handleClickOverlay: function() {
      this.handleClose()
    }
  }
})
